//定义项目的一级路由规则
import { lazy, Suspense } from 'react'
import { Route, Redirect, Switch } from 'react-router-dom'
import Loading from '@/components/Loading'
// 使用lazy 方法导入需要的组件
const Login = lazy(() => import('@/views/login/Index'))
const Dashboard = lazy(() => import('@/views/dashboard/Dashboard'))
const Rules = () => {
    return (
        <Suspense fallback={<Loading />}>
            <Switch>
                <Route path='/login' component={Login}></Route>
                <Route path='/dashboard' component={Dashboard}></Route>
                <Redirect from='/' to='/login' exact></Redirect>
            </Switch >
        </Suspense >
    );

}

export default Rules;
